<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<hade>
    <div data-th-replace="layout/head-top"></div>
</hade>
<body>
    <div class="m-t-lg">
        <dl class="dl-horizontal">
            <dt>免费直播管理名称：</dt>
            <dd class="m-r"><span class="fs12 c-4e" th:text="${courseOpen['courseName']}"></span></dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>隶属专业：</dt>
            <dd class="m-r">
                <th:block th:if="!${#lists.isEmpty(courseOpen['subjectList'])}">
                    <span class="fs12 c-4e" th:each="subject,subIndex : ${courseOpen['subjectList']}">
                        <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                        <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                            <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                            <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                        </th:block>
                        <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                        <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                    </span>
                </th:block>
                <th:block th:if="${#lists.isEmpty(courseOpen['subjectList'])}">
                    <span class="fs12 c-4e">—</span>
                </th:block>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>授课讲师：</dt>
            <dd class="m-r"><span class="fs12 c-4e" th:text="${courseOpen['teacher']['teacherName']}"></span></dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>课程描述：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:utext="${courseOpen['details']}"></span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>开课时间：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:text="${#strings.substring(courseOpen['openTime'],0,16)}"></span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>结束时间：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:text="${#strings.substring(courseOpen['endTime'],0,16)}"></span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <th:block th:if="${courseOpen['playType']}=='CC'">
            <dl class="dl-horizontal">
                <dt>直播识别码：</dt>
                <dd class="m-r"><span class="fs12 c-4e" th:text="${courseOpen['liveUrl']}"></span></dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>讲师地址：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${courseOpen['teacherUrl']}"></span>
                    <input type="hidden" id="teacherUrl" th:value="${courseOpen['teacherUrl']}">
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>讲师地址二维码：</dt>
                <dd class="m-r">
                    <div class="col-sm-3">
                        <div class="image">
                            <img alt="讲师地址二维码" id="teacherQRCodeInp" class="img-responsive" th:src="@{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                        </div>
                    </div>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>讲师参加码：</dt>
                <dd class="m-r"><span class="fs12 c-4e" th:text="${courseOpen['teacherCode']}"></span></dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>学员地址：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${courseOpen['studentUrl']}"></span>
                    <input type="hidden" id="studentUrl" th:value="${courseOpen['studentUrl']}">
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>学员地址二维码：</dt>
                <dd class="m-r">
                    <div class="col-sm-3">
                        <div class="image">
                            <img alt="学员地址二维码" id="studentQRCodeInp" class="img-responsive" th:src="@{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                        </div>
                    </div>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>学员参加码：</dt>
                <dd class="m-r"><span class="fs12 c-4e" th:text="${courseOpen['studentCode']}"></span></dd>
            </dl>
                <div class="hr-line-dashed"></div>
        </th:block>
        <dl class="dl-horizontal">
            <dt>回放地址：</dt>
            <dd class="m-r"><span class="fs12 c-4e" th:text="${courseOpen['backCode']}"></span></dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>学员上课记录：</dt>
            <dd class="m-r">
                <a id="downloadExcel" th:href="@{/admin/course/open/downloadExcel?courseOpenId={courseOpenId}(courseOpenId=${courseOpen ['id']})}">
                    <button style="width: 10px;" class="btn btn-block btn-w-m btn-primary" type="button">
                        <i class="fa fa-download"></i> 导出数据
                    </button>
                </a>
                <span class="help-block m-b-none c-999">上课记录6小时后生成</span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>课程特点：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:text="${#strings.isEmpty(courseOpen['trait'])}?'未填写':${courseOpen['trait']}">
                </span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>适宜学员：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:text="${#strings.isEmpty(courseOpen['suitableUser'])}?'未填写':${courseOpen['suitableUser']}">
                </span>
            </dd>
        </dl>

        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>状态：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e">
                    <span th:if="${courseOpen['status']}==1"  class="label label-info">正常</span>
                    <span th:if="${courseOpen['status']}==2" class="label label-danger">冻结</span>
                </span>
            </dd>
        </dl>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/common/qrcode/jquery.qrcode.min.js?v={v}(path=${staticPath}, v=${v})}"></script>
    <script type="text/javascript">
        $(function () {
            QRCodeInp();
            /**
             * 生成二维码
             * @constructor
             */
            function QRCodeInp(){
                var studentUrl = $('#studentUrl').val();
                if(studentUrl!=null && studentUrl!=''){
                    var qrcode = $('#studentQRCodeInp').qrcode({render: "canvas", height: 140, width: 140, correctLevel: 2, text: studentUrl}).find('canvas').hide();
                    $("#studentQRCodeInp").attr('src', qrcode[0].toDataURL());
                }
                var teacherUrl = $('#teacherUrl').val();
                if(teacherUrl!=null && teacherUrl!=''){
                    var qrcode = $('#teacherQRCodeInp').qrcode({render: "canvas", height: 140, width: 140, correctLevel: 2, text: teacherUrl}).find('canvas').hide();
                    $("#teacherQRCodeInp").attr('src', qrcode[0].toDataURL());
                }
            }
        })
    </script>
</body>
</html>